﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace HFK.DxFluentUI.LanguageModel.HorizontalGrid
{
  public interface HorizontalGridMainViewElement<ComponentType> : FluentBaseElement, HorizontalGridViewGroupingElement<HorizontalGridMainViewElement<ComponentType>>, EditableElement<HorizontalGridMainViewElement<ComponentType>>
  {
    HorizontalGridColumnElement<ComponentType> AddColumn(string caption);
    HorizontalGridColumnElement<ComponentType> AddColumn<U>(string caption, Expression<Func<ComponentType, U>> expression);

    HorizontalGridDetailViewElement<ComponentType, ListedType> AddDetailView<ListedType>(string caption, Action<HorizontalGridDetailViewElement<ComponentType, ListedType>> apply) where ListedType : class;

    HorizontalGridMainViewElement<ComponentType> OptimizeColumnWidthForText();
    HorizontalGridMainViewElement<ComponentType> OptimizeColumnWidthForView();
  }
}
